//
// Created by redcat1 on 12.05.2024.
//

#ifndef TASK_ARRAY_FIGURES_H
#define TASK_ARRAY_FIGURES_H

#include <string>

//
class Figure
{
public:
  virtual double Area() const = 0;
  virtual double Perimeter() const = 0;
  virtual std::string Type() const = 0;
  virtual ~Figure() = default;
};

//
class Rectangle : public Figure
{
public:
  Rectangle(double length_, double width_);
  Rectangle(const Rectangle& other) = default;
  double Area() const override;
  double Perimeter() const override;
  std::string Type() const override {return "Rectangle";}

private:
  double length;
  double width;
};

//
class Circle : public Figure
{
public:
  explicit Circle(double radius_);
  Circle(const Circle& other) = default;
  double Area() const override;
  double Perimeter() const override;
  std::string Type() const override {return "Circle";}

private:
  double radius;
};

//
class RightTriangle : public Figure
{
public:
  RightTriangle(double leg1_, double leg2_);
  RightTriangle(const RightTriangle& other) = default;
  double Area() const override;
  double Perimeter() const override;
  std::string Type() const override {return "RightTriangle";}

private:
  double leg1;
  double leg2;
};


#endif //TASK_ARRAY_FIGURES_H
